package com.freemarker.demo.utils;

import java.util.Arrays;
import java.util.List;
/**
 * @CLASSNAME ListDemo
 * @DESCRIPTION 描述
 * @AUTHOR chen
 * @DATE 2019-03-24 13:56
 **/
public class ListDemo {

    public static void main(String[] args) {

        List<Integer> l = Arrays.asList( 1,7,3,5,4,2,9 );
        List<String> l1 = Arrays.asList( "a","c","d","b" );

        l1.sort( String::compareTo );
        System.out.println(l1);
        int x = l.size();
        l.sort( Integer::compareTo );
        System.out.println(l);
        System.out.println(l.get( x/2 ));
        int x1 = 5 ;
        int i ;
        for ( i = 1; i < l.size(); i++) {
            if (x1 == l.get( i ));
            return;
        }
        System.out.println(i);

    }
}
